package net.mihome.app.bean;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

public class Community extends Entity{
	private String name;
    private String detailAddress;
    private String province;
    private String city;
    private String district;
    private String address;
    private String baoxiuMobile;
    private String shopMobile;

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getDistrict() {
        return district;
    }

    public void setDistrict(String district) {
        this.district = district;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getDetailAddress() {
        return detailAddress;
    }

    public void setDetailAddress(String detailAddress) {
        this.detailAddress = detailAddress;
    }

    public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	public static Community parse(Map map){
		Community comminuty=new Community();
		Double ids=(Double) map.get("id");
		comminuty.setId(ids.intValue());
		comminuty.setName((String)map.get("name"));
        comminuty.setDetailAddress((String) map.get("detail_address"));
        comminuty.setAddress((String) map.get("address"));
        comminuty.setCity((String) map.get("city"));
        comminuty.setDistrict((String) map.get("district"));
        comminuty.setProvince((String) map.get("province"));
        comminuty.setBaoxiuMobile((String) map.get("baoxiu_mobile"));
        comminuty.setShopMobile((String) map.get("shop_mobile"));
		return comminuty;
	}
    public static List<Community> parseList(List<Map> list ){
        if(list!=null&&!list.isEmpty()){
            List<Community> communityList=new ArrayList<>();
            Iterator iterator=list.iterator();
            while(iterator.hasNext()){
                Map map=(Map) iterator.next();
                Community comminuty=Community.parse(map);
                communityList.add(comminuty);
            }
            return communityList;
        }else{
            return null;
        }
    }

    public String getShopMobile() {
        return shopMobile;
    }

    public void setShopMobile(String shopMobile) {
        this.shopMobile = shopMobile;
    }

    public String getBaoxiuMobile() {
        return baoxiuMobile;
    }

    public void setBaoxiuMobile(String baoxiuMobile) {
        this.baoxiuMobile = baoxiuMobile;
    }
}
